﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using G15_Agent.BUS;
using G15_Agent.Helpers.ServiceHelpers.HotelServiceHelpers;
using G15_Agent.Helpers.ServiceHelpers.TransportServiceHelpers;
using G15_Agent.Helpers.ServiceHelpers.AirplaneServiceHelpers;
using G15_Agent.Helpers.ServiceHelpers.TravelServiceHelpers;

namespace G15_Agent.Helpers.ServiceHelpers
{
    static public class ServiceFactory
    {
        static public List<AirplaneService> Airplane = new List<AirplaneService>(
            new AirplaneService[] { 
                new G03AirplaneService("g03airplane", "abc", "123") });

        static public List<HotelService> Hotel = new List<HotelService>(
            new HotelService[] { 
                new G08HotelService("g08hotel", "truongan", "654321"),
                new G11HotelService("H000000003", "hayato.gok@gmail.com", "123456")
            });

        static public List<TransportService> Transport = new List<TransportService>(
            new TransportService[] { 
                new G07TransportService("g07transport", "kfc", "kfc") });

        static public List<TravelSerivce> Travel = new List<TravelSerivce>(
            new TravelSerivce[] {
                new G11TravelService("TV000000003", "hayato.gok@gmail.com", "12345"),
                new G12TravelService("g12travel", "hayato.gok@gmail.com", "12345")});
        static public List<Service> AllService {
            get
            {
                List<Service> result = new List<Service>();
                result.AddRange(Airplane);
                result.AddRange(Hotel);
                result.AddRange(Transport);
                result.AddRange(Travel);

                return result;
            }
        }

        static public Service GetService(string serviceID)
        {
            foreach (var service in AllService)
                if (service.ServiceID == serviceID)
                    return service;
            return null;
        }

        //public ServiceFactory()
        //{
        //    Airplane = new List<AirplaneService>();
        //    Hotel = new List<HotelService>();
        //    Transport = new List<TransportService>();
        //    Travel = new List<TravelSerivce>();
        //}

        //public void Init()
        //{
        //    Travel.Add(new G11TravelService("g11travel", "hayato.gok@gmail.com", "12345"));
        //    Airplane.Add(new G03AirplaneService("g03airplane", "", ""));
        //    Hotel.Add(new G08HotelService("g08hotel", "", ""));
        //    Transport.Add(new G07TransportService("g07transport", "", ""));
        //}
    }
}